'use strict';

import { Application } from 'egg';
/**
 * 
 * @param app 
 * 管理后台路由
 * 官网管理后台的路由处理
 */
export default function(app: Application) {
    //高德官网接口
  const{router,controller}=app;
  const auth=app.middleware.auth()
 // const after_response=app.middleware.after_response();
 
  //管理员登录登出
  router.post("/manage/login",controller.manage.admin.login);
  router.post("/manage/loginout",controller.manage.admin.loginout);
  //管理员
  router.get("/manage/admin_info",auth,controller.manage.admin.info);
  router.post("/manage/admin_add",controller.manage.admin.add);
  router.post("/manage/pass_check",controller.manage.admin.check);
  router.post("/manage/admin_update",controller.manage.admin.update);
  router.post("/manage/admin_del",controller.manage.admin.del);
  router.get("/manage/admin_list",controller.manage.admin.list);

  //产品
  router.get("/manage/product_info",controller.manage.product.info); 
  router.post("/manage/product_add",controller.manage.product.add);
  router.post("/manage/product_update",controller.manage.product.update);
  router.post("/manage/product_del",controller.manage.product.del);
  router.get("/manage/product_list",controller.manage.product.list);
  
  //解决方案
  router.get("/manage/solution_info",controller.manage.solution.info); 
  router.post("/manage/solution_add",controller.manage.solution.add);
  router.post("/manage/solution_update",controller.manage.solution.update);
  router.post("/manage/solution_del",controller.manage.solution.del);
  router.get("/manage/solution_list",controller.manage.solution.list);

  //服务支持
  router.get("/manage/service_info",controller.manage.service.info); 
  router.post("/manage/service_add",controller.manage.service.add);
  router.post("/manage/service_update",controller.manage.service.update);
  router.post("/manage/service_del",controller.manage.service.del);
  router.get("/manage/service_list",controller.manage.service.list);
  
  //关于我们
  router.get("/manage/about_info",controller.manage.about.info); 
  router.post("/manage/about_add",controller.manage.about.add);

  //导航图
  router.get("/manage/banner_info",controller.manage.banner.info); 
  router.post("/manage/banner_add",controller.manage.banner.add);
  router.post("/manage/banner_update",controller.manage.banner.update);
  router.post("/manage/banner_del",controller.manage.banner.del);
  router.get("/manage/banner_list",controller.manage.banner.list);

  //产品类型
  router.get("/manage/category_info",controller.manage.category.info); 
  router.post("/manage/category_add",controller.manage.category.add);
  router.post("/manage/category_update",controller.manage.category.update);
  router.post("/manage/category_del",controller.manage.category.del);
  router.get("/manage/category_list",controller.manage.category.list);
  router.post("/manage/add_category_subs",controller.manage.category.add_category_subs);
  router.get("/manage/product_add_query",controller.manage.product.add_query);
   //产品子类
   router.get("/manage/sub_info",controller.manage.sub.info); 
   router.post("/manage/sub_add",controller.manage.sub.add);
   router.post("/manage/sub_update",controller.manage.sub.update);
   router.post("/manage/sub_del",controller.manage.sub.del);
   router.get("/manage/sub_list",controller.manage.sub.list);

  //资源管理
  router.post("/manage/resource_uploads",controller.manage.resource.uploads);
  router.post("/manage/resource_upload",controller.manage.resource.upload);
  router.post("/manage/resource_update",controller.manage.resource.update);
  router.post("/manage/resource_del",controller.manage.resource.del);
  router.get("/manage/resource_list",controller.manage.resource.list);
  router.get("/manage/resource_info",controller.manage.resource.info);
  router.post("/manage/upload_url",controller.manage.resource.upload_url);
  router.post("/manage/upload_urls",controller.manage.resource.upload_urls);
  
  //招聘管理
  router.post("/manage/job_import",controller.manage.hire.import);
  router.post("/manage/hire_update",controller.manage.hire.update);
  router.post("/manage/hire_add",controller.manage.hire.add);
  router.post("/manage/hire_del",controller.manage.hire.del);
  router.get("/manage/hire_list",controller.manage.hire.list);
  router.get("/manage/hire_info",controller.manage.hire.info);
  
  //新闻管理
  router.post("/manage/news_update",controller.manage.news.update);
  router.post("/manage/news_add",controller.manage.news.add);
  router.post("/manage/news_del",controller.manage.news.del);
  router.get("/manage/news_list",controller.manage.news.list);
  router.get("/manage/news_info",controller.manage.news.info);

  //markedown

  router.get("/markdown",controller.manage.markdown.toHtml);
  router.get("/markdown_pdf",controller.manage.markdown.toPdf);

  //通用
  router.post("/manage/common_move",controller.manage.common.move);
  router.get("/manage/common_sync_sort",controller.manage.common.sync_sort);
  router.get("/manage/common_sync_banner",controller.manage.common.sync_banner);
}